package com.silence.basic_learn;

public abstract class Animal {
    private String name;

    public abstract void sound();

    public abstract String food();

    //模板方法设计模式
    public final void fav_food(){
        System.out.println("我喜欢吃的食物是:");
        System.out.println(food());
        System.out.println("以上就是我喜欢吃的食物!");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
